<!--读者主页-->
<html>
<head>
    <meta charset="utf-8">
    <!--<meta http-equiv="X-UA-Compatible" content="IE=edge">-->
    <!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
    <title>${readercard.name}的主页</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="js/jquery-3.3.1.js"></script>
    <script src="js/bootstrap.min.js" ></script>
    <script src="js/jquery.cookie-1.4.1.min.js"></script>
    <script src="js/getParameter.js"></script>
    <script src="js/myCookie.js"></script>
    <style>
        body{
            background-color: rgb(240,242,245);
        }
        #reader *{
            color: #333;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-default" role="navigation" style="background-color:#fff" style="background-color:#fff">
    <div class="container-fluid">
        <div class="navbar-header" style="margin-left: 8%;margin-right: 1%">
            <a class="navbar-brand jump" name="test.html">我的图书馆</a>
        </div>
        <div class="collapse navbar-collapse" id="example-navbar-collapse">
            <ul class="nav navbar-nav navbar-left" id="nav">
                <li>
                    <a class="jump" name="reader_book_query.html">图书查询</a>
                </li>
                <li>
                    <a class="jump" name="reader_info.html" >个人信息</a>
                </li>
                <li >
                    <a class="jump" name="reader_lend_list.html" >我的借还</a>
                </li>
                <li >
                    <a class="jump" name="reader_repasswd.html" >密码修改</a>
                </li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li id="reader">
                    <a class="quit"></a>
                </li>
                <li><a class="quit"><span class="glyphicon glyphicon-log-in"></span>&nbsp;退出</a></li>
            </ul>
        </div>
    </div>
</nav>

<div id="middle"></div>
</body>
<script>

    var reader_id;
    //加载session
    $(function () {
        reader_load();
        $("#middle").load("test.html");
    });
    function reader_load(){
        $.post("user/getReader",function (data) {
            if (data.obj != null) {
                $("#reader a").removeClass("quit");
                $("#reader a").html("<span class=\"glyphicon glyphicon-user\"></span>&nbsp;"+data.obj.name+"，已登录");
            }else {
                $("#reader a").addClass("quit");
                $("#reader a").html("<span class=\"glyphicon glyphicon-user\"></span>&nbsp;请登录");
            }
            reader_id = data.obj.reader_id;
        },"json");
    }
    //清除session
    $(".quit").click(function () {
        $.post("user/quitReader", function () {
            // location.href="index.html";
            history.back(-1);
        },"json");
    });
    //点击效果
    $(".Jump").click(function () {
        $("#nav li").removeClass("active");
    });
    $("#nav li").click(function () {
        $(this).addClass("active");
    });
</script>
<script src="js/integrationJS.js"></script>
</html>
